var app = getApp(),
  common = require("../common/common.js");

Page({
  data: {
    footerCurr: 3
  },
  // 选择科目展示
  checkedModule(res) {
    console.log(res.currentTarget.dataset.ind)
    let _t = this
    _t.setData({
      moduleCheck: res.currentTarget.dataset.ind
    })
  },

  // 选择模拟考试科目
  chooseSubject(t) {
    let _t = this
    let moduleName = t.currentTarget.dataset.name
    let id = t.currentTarget.dataset.id
    let type = t.currentTarget.dataset.type
    let category_id = t.currentTarget.dataset.category_id
    
    wx.navigateTo({
      url: '/xc_train/pages/practice/topic/topic?name=' + moduleName + '&id=' + id + '&t=' + type + '&category_id=' + category_id
    })
  },
  // 科目列表
  subjects(t) {
    app.util.request({
      url: 'entry/wxapp/SelectAllType',
      data: {},
      success: function (a) {
        console.log(a)
        t.setData({
          module: a.data.data
        })
      }
    })
  },
  onLoad: function (options) {
    let that = this
    common.config(that), common.theme(that)
    that.subjects(that)
  },

  onReady: function () {

  },
  onShow: function () {

  },
  onHide: function () {

  },
  onUnload: function () {

  },
  onPullDownRefresh: function () {

  },
  onReachBottom: function () {

  },
  onShareAppMessage: function () {

  }
})